import java.util.Scanner;

public class Homework0324first {
    public static void main(String[] args){
        Scanner reader=new Scanner(System.in);
        System.out.println("请输入小王的性别：");
        String xwGender=reader.next();
        System.out.println("请输入小张的性别：");
        String xzGender=reader.next();
        if((xwGender.equals("男")&&xzGender.equals("女")||xwGender.equals("女")&&xzGender.equals("男"))){
            System.out.println("恭喜！可以结婚");
        }else{
            System.out.println("抱歉！你们不可以结婚！");
        }
    }
}
